<template>
  <div id="vue-admin-beautiful">
    <router-view />
  </div>
</template>

<script>
  export default {
    name: 'App',
    created() {
      this.resizeFun()
    },
    mounted() {
      // if (localStorage.getItem('token')) {
      //   this.$store.dispatch("biaozhun/setZgdwList");
      //   this.$store.dispatch("biaozhun/setWzqfList");
      //   this.$store.dispatch("biaozhun/setWzzyList");
      //   this.$store.dispatch("biaozhun/setKuFangList", this.$store.getters['user/cangkuid']);
      //   this.$store.dispatch("biaozhun/setYhkfList");
      //   this.$store.dispatch("biaozhun/setCklxList");
      // }
    },
    methods: {
      resizeFun() {
        let docEle = document.documentElement,
          resizeEvt =
            'orientationchange' in window ? 'orientationchange' : 'resize',
          resizeFun = () => {
            let clientWidth = docEle.clientWidth
            if (!clientWidth) return
            // 100是换算系数，相当于1rem=100px
            //1920是作为设计图的基准，我这是按照1920*1080的分辨率，可自行修改
            docEle.style.fontSize = 100 * (clientWidth / 1920) + 'px'
          }
        if (!document.addEventListener) return
        window.addEventListener(resizeEvt, resizeFun, false)
        window.addEventListener('DOMContentLoaded', resizeFun, false)
        resizeFun()
      },
    },
  }
</script>
<style lang="scss">
  #vue-admin-beautiful {
    .el-button--primary {
      background-color: #2171d4 !important;
      border-color: #2171d4 !important;
    }
  }
</style>
